<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> - 基本表单</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="../favicon.ico">
    <link href="/Public/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link rel="stylesheet" href="/Public/css/ace.min.css"/>
    <link href="/Public/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/Public/css/animate.css" rel="stylesheet">
    <link href="/Public/css/style.css?v=4.1.0" rel="stylesheet">
    <style type="text/css">
        .mail-search {
            max-width: 1600px !important;
        }

        .w-400 {
            width: 400px;
        }

        .w-300 {
            width: 300px;
        }

        .fr {
            float: right;
        }
    </style>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>订单管理-
                        <small>所有订单</small>
                    </h5>
                    <div class="ibox-tools">
                        <button class="btn btn-info" type="button" onclick="c_export()">导出</button>
                    </div>
                </div>

                <div class="ibox-content">
                    <form method="get" action="<{$SRVER_NAME}>/admin.php/Achievements/call_statistics" class=" mail-search">
                        <div class="col-sm-3 w-300">
                            开始时间:<input type="text" placeholder="请输入开始时间" id="starttime" name="start_time" value="<{$start_time}>">
                        </div>
                        <div class="col-sm-3 w-300">
                            结束时间:<input type="text" placeholder="请输入结束时间" id="endtime" name="end_time" value="<{$end_time}>">
                        </div>

                        <div class="input-group-btn">
                                <button type="submit" class="btn btn-sm btn-primary">
                                    搜索
                                </button>
                            </div>
                        </form>
                        <table class="table table-striped table-bordered table-hover" id="sample-table">
                            <thead>
                            <tr>
                                <th >姓名</th>
                                <th >电话总数</th>
                                <th>外呼总数</th>
                                <th >有效外呼</th>
                                <th >呼入总数</th>
                                <th >呼入接听总数</th>
                                <th >查看</th>
                            </tr>
                            </thead>
                            <tbody>
                            <volist name="data" id="vs">
                                <tr id="tr_<{$vs.id}>">
                                    <th><{$vs.name}></th>
                                    <th><{$vs.total_call}></th>
                                    <th><{$vs.out_call}></th>
                                    <th><{$vs.effective_out_call}></th>
                                    <th><{$vs.in_call}></th>
                                    <th><{$vs.get_in_call}></th>
                                    <th><a style="margin-right: 20px" onclick="details('<{$vs.name}>',1)">外呼查看</a> <a onclick="details('<{$vs.name}>',2)">呼入查看</a></th>
                                </tr>
                            </volist>
                            </tbody>
                        </table>

                </div>
            </div>

        </div>
    </div>
</div>


<!-- 全局js -->
<script src="/Public/js/jquery.min.js?v=2.1.4"></script>
<script src="/Public/js/bootstrap.min.js?v=3.3.6"></script>
<!-- 自定义js -->
<script src="/Public/js/content.js?v=1.0.0"></script>
<script src="/Public/js/plugins/layer/layer.min.js"></script>
<script src="/Public/js/ajaxfileupload.js"></script>

<script src="/Public/js/jquery.dataTables.min.js"></script>
<script src="/Public/js/jquery.dataTables.bootstrap.js"></script>
<script src="/Public/js/plugins/layer/layer.min.js"></script>
<script src="/Public/js/plugins/layer/laydate/laydate.js"></script>
<!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript">
    laydate({
        elem: '#starttime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
        event: 'focus', //响应事件。如果没有传入event，则按照默认的click
        istime: true, //是否开启时间选择
        istoday: true,
        festival: true,
        start: laydate.now(0, "YYYY/MM/DD hh:00:00"),
        format: 'YYYY-MM-DD hh:mm:ss'
    });
    laydate({
        elem: '#endtime', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎，因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
        event: 'focus', //响应事件。如果没有传入event，则按照默认的click
        istime: true, //是否开启时间选择
        istoday: true,
        festival: true,
        start: laydate.now(0, "YYYY/MM/DD hh:00:00"),
        format: 'YYYY-MM-DD hh:mm:ss'
    });
</script>

<script>

    var  data="<{$test}>";
    console.log('daaa',data);
    var printurl = "<{$SRVER_NAME}>/admin.php/Achievements/excel_export";
    function c_export() {
        var starttime = $("#starttime").val();
        var endtime = $("#endtime").val();
        $.post(printurl, {
                start_time: starttime,
                end_time: endtime,
            },
            function (data) {
                if (data.code == '1001') {
                    layer.msg('导出成功!', {icon: 6, time: 1000});
                    location.href = data.url;
                } else {
                    layer.msg(data.error, {icon: 5, time: 1000});
                }
            }, 'json');
    }


    function details(name,type) {
        var starttime = $("#starttime").val();
        var endtime = $("#endtime").val();
        window.location.href="<{$SRVER_NAME}>/admin.php/Achievements/kf_call_out?type="+type+"&name="+name+"&s_time="+starttime+"&e_time="+endtime;
    }

</script>
</body>
</html>
